<template>
  <div id="home">
    
    <div class="swiper-wrap">
      <div class="site-category"></div>
      <swiper ref="mySwiper" :options="swiperOptions">
        <swiper-slide>
          <img src="./image/6ef43cf9f138a7fc3a39273d7e3d13b6.jpg" alt />
        </swiper-slide>
        <swiper-slide>
          <img src="./image/12a95d14eec558d7ebd585b1b3b725b0.jpg" alt />
        </swiper-slide>
        <swiper-slide>
          <img src="./image/29d0a0b83843d7d1ba7a30a9400257e9.jpg" alt />
        </swiper-slide>
        <swiper-slide>
          <img src="./image/b4eaa00be8d636a5f7b843b0704548ad.jpg" alt />
        </swiper-slide>
        <swiper-slide>
          <img src="./image/e52c3e98602b90f198ec316dce253cba.jpg" alt />
        </swiper-slide>
        <!-- // 分页器 -->
        <div class="swiper-pagination" slot="pagination"></div>
        <div class="swiper-button-prev" slot="buttton-prev"></div>
        <div class="swiper-button-next" slot="buttton-next"></div>
      </swiper>
    </div>
  </div>
</template>
<script>



import { Swiper, SwiperSlide, directive } from "vue-awesome-swiper";
import "swiper/css/swiper.css";
export default {
  name: "home",
  components: {
    Swiper,
    SwiperSlide
  },
  data() {
    return {
      swiperOptions: {
        effect: "fade",
        autoplay: true, // 自动播放
        loop: true, // 环路，到最后一张轮播图自动切换第一张
        pagination: {
          el: ".swiper-pagination",
          clickable: true // 开启分页器点击效果
        },
        navigation: {
          nextEl: ".swiper-button-next",
          prevEl: ".swiper-button-prev"
        }
      }
    };
  },
  directives: {
    swiper: directive
  }
};
</script>
<style scoped>
#home{
    width: 1240px;
    margin: 0 auto;
}
/* 轮播图容器 */
.swiper-wrap {
  position: relative;
}
.swiper-wrap img {
  width: 100%;
}
.site-category {
  height: 99.4%;
  width: 230px;
  position: absolute;
  left: 0;
  top: 0;
  background: #000;
  z-index: 9;
  opacity: .5;
}
</style>